package server;
// ClientData.java
// Represents one client
// Contains all client properties to be used by updateThread
// and setters and getters
// as well as I/O stream objects.

import java.net.Socket;
public class ClientData
{
	// Client properties
	private boolean loggedIn = false;		// Valid user/pass combo
	private int ID = -1;					// Session ID
	private int x;							// Current position
	private int y;
	private int xDesired;					// Desired position
	private int yDesired;
	private int score;						// Score

	// Network connections
	private NetworkOutput networkOutput;
	private NetworkInputThread networkInput;
	private Thread inputThread;

	public ClientData(int id, Socket s, UpdateThread u)
	{
		ID = id;
		networkInput = new NetworkInputThread(id, s, u);
		inputThread = new Thread(networkInput);
		inputThread.start();
		networkOutput = new NetworkOutput(s);
	}

	public void setLoggedIn(boolean l)
	{
		loggedIn = l;
	}

	public boolean isLoggedIn()
	{
		return loggedIn;
	}

	public int getID()
	{
		return ID;
	}

	public void setX(int xPos)
	{
		x = xPos;
	}

	public int getX()
	{
		return x;
	}

	public void setY(int yPos)
	{
		y = yPos;
	}

	public int getY()
	{
		return y;
	}
	public void setXDesired(int xPos)
	{
		xDesired = xPos;
	}

	public int getXDesired()
	{
		return xDesired;
	}

	public void setYDesired(int yPos)
	{
		yDesired = yPos;
	}

	public int getYDesired()
	{
		return yDesired;
	}

	public void setScore(int s)
	{
		score = s;
	}

	public int getScore()
	{
		return score;
	}

	public NetworkOutput getNetworkOutput()
	{
		return networkOutput;
	}
}